From: Jan-Erik Rediger Date: Wed, 27 Aug 2025 01:09:58 +0000 (+0000) Subject: Bug 1983736 - Patch jsonschema to work with Python 3.14+ r=mach-reviewers,ahal,ahochh... X-Git-Tag: archive/raspbian/140.15.0esr-1+rpi1^2~21 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a07dbe9610934520874a1403f4960d6252f2fc70;p=firefox-esr.git Bug 1983736 - Patch jsonschema to work with Python 3.14+ r=mach-reviewers,ahal,ahochheiden Differential Revision: https://phabricator.services.mozilla.com/D262335 Gbp-Pq: Topic fixes Gbp-Pq: Name Bug-1983736-Patch-jsonschema-to-work-with-Python-3.1.patch --- diff --git a/python/mozbuild/mozbuild/vendor/vendor_python.py b/python/mozbuild/mozbuild/vendor/vendor_python.py index 9acee946fc4..2801e1b685d 100644 --- a/python/mozbuild/mozbuild/vendor/vendor_python.py +++ b/python/mozbuild/mozbuild/vendor/vendor_python.py @@ -40,6 +40,10 @@ EXCLUDED_PACKAGES = { # modified 'dummy' version of it so that the dependency checks still succeed, but # if it ever is attempted to be used, it will fail gracefully. "ansicon", + # jsonschema 4.17.3 is incompatible with Python 3.14+, + # but later versions use a dependency with Rust components, which we thus can't vendor. + # For now we apply the minimal patch to jsonschema to make it work again. + "jsonschema", } diff --git a/third_party/python/jsonschema/jsonschema/validators.py b/third_party/python/jsonschema/jsonschema/validators.py index 66e803ea2d0..88316a8bb72 100644 --- a/third_party/python/jsonschema/jsonschema/validators.py +++ b/third_party/python/jsonschema/jsonschema/validators.py @@ -875,8 +875,11 @@ class RefResolver: return None uri, fragment = urldefrag(url) for subschema in subschemas: + id = subschema["$id"] + if not isinstance(id, str): + continue target_uri = self._urljoin_cache( - self.resolution_scope, subschema["$id"], + self.resolution_scope, id, ) if target_uri.rstrip("/") == uri.rstrip("/"): if fragment: